<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <title>Flat UI</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <!-- Loading Bootstrap -->
    <link href="../assets/css/bootstrap.css" rel="stylesheet">

    <!-- Loading Flat UI -->
    <link href="../assets/css/flat-ui.css" rel="stylesheet">
    <link href="../assets/css/github.css" rel="stylesheet">
    <link rel="shortcut icon" href="../assets/images/favicon.ico">

    <!-- HTML5 shim, for IE6-8 support of HTML5 elements. All other JS at the end of file. -->
    <!--[if lt IE 9]>
    <script src="js/html5shiv.js"></script>
    <![endif]-->
  </head>
  <body>


    <div class="container">
      <div class="demo-headline">
        <h1 class="demo-logo">Lettuce
          <small>Behaviour Driven Development for python</small></h1>
      </div>
      <div class="row">
        <div class="span4">
          <div class="sidebar-nav">
            <ul class="share mrl">
              <div class="btn btn-primary btn-block btn-large">
                <h3>Sections</h3>
              </div>
              
              <a class="btn btn-inverse btn-block btn-large"
       href="#scenario-outlines">
         scenario outlines
    </a>
  
              
            </ul>
          </div>
        </div>
        <div class="span8">
          <h1 id="scenario-outlines" name="scenario-outlines"><a href="#scenario-outlines">scenario outlines</a></h1>
<p>On our :ref:first description file&lt;tutorial-simple&gt;,
<code>zero.feature</code>, all scenarios were similar. This made us repeat most of
the text again and again.</p>

<p><strong>Isn&#39;t there a better way to deal with this - when several scenarios
are almost equal and only some values change?</strong></p>

<p>Yes, there is! :) You just need to use scenarios outlines.</p>

<p>An example is shown below:</p>
<div class="highlight"><pre name="scenario-outlines-example-1"><span class="n">Feature</span><span class="o">:</span> <span class="n">Compute</span> <span class="n">factorial</span>
  <span class="n">In</span> <span class="n">order</span> <span class="n">to</span> <span class="n">play</span> <span class="k">with</span> <span class="n">Lettuce</span>
  <span class="n">As</span> <span class="n">beginners</span>
  <span class="n">We</span><span class="err">'</span><span class="n">ll</span> <span class="n">implement</span> <span class="n">factorial</span>

  <span class="n">Scenario</span> <span class="n">Outline</span><span class="o">:</span> <span class="n">Factorials</span> <span class="o">[</span><span class="mi">0</span><span class="o">-</span><span class="mi">4</span><span class="o">]</span>
    <span class="n">Given</span> <span class="n">I</span> <span class="n">have</span> <span class="n">the</span> <span class="n">number</span> <span class="o">&lt;</span><span class="n">number</span><span class="o">&gt;</span>
    <span class="n">When</span> <span class="n">I</span> <span class="n">compute</span> <span class="n">its</span> <span class="n">factorial</span>
    <span class="n">Then</span> <span class="n">I</span> <span class="n">see</span> <span class="n">the</span> <span class="n">number</span> <span class="o">&lt;</span><span class="n">result</span><span class="o">&gt;</span>

  <span class="n">Examples</span><span class="o">:</span>
    <span class="o">|</span> <span class="n">number</span> <span class="o">|</span> <span class="n">result</span> <span class="o">|</span>
    <span class="o">|</span> <span class="mi">0</span>      <span class="o">|</span> <span class="mi">1</span>      <span class="o">|</span>
    <span class="o">|</span> <span class="mi">1</span>      <span class="o">|</span> <span class="mi">1</span>      <span class="o">|</span>
    <span class="o">|</span> <span class="mi">2</span>      <span class="o">|</span> <span class="mi">2</span>      <span class="o">|</span>
    <span class="o">|</span> <span class="mi">3</span>      <span class="o">|</span> <span class="mi">6</span>      <span class="o">|</span>
    <span class="o">|</span> <span class="mi">4</span>      <span class="o">|</span> <span class="mi">24</span>     <span class="o">|</span>
</pre></div>
<p>This way, you will only need to provide the values that really change,
reducing &ldquo;copy &amp; paste&rdquo; work and making your tests more clear.</p>

<p><img src="./screenshot7.png" title="None" alt="image" /></p>

        </div>
      </div>
    </div> <!-- /container -->

    <footer>
      <div class="container">
        <div class="row">
          <div class="span7">
            <h3 class="footer-title">Lettuce</h3>
            <p>Lettuce is maintained by gabrielfalcao. <br />
              This documentation was generated automatically by <a href="http://octomarks.io/gabrielfalcao/markment">Markment</a>.
            </p>
            <p>
              This theme was written by Gabriel Falcão using the <a href="http://designmodo.github.io/Flat-UI/">Flat-UI</a> library by
              <a class="footer-brand" href="http://designmodo.com" target="_blank">
                <img src="../assets/images/footer/logo.png" alt="Designmodo.com">
              </a>
            </p>
          </div> <!-- /span8 -->

          <div class="span5">
            <div class="footer-banner">
              <h3 class="footer-title">Table of contents</h3>
              <ul>
                 
                <li>
                  <a href="../contents.html">
                        contents.md
                  </a>
                </li>
                 
                <li>
                  <a href="../index.html">
                        index.md
                  </a>
                </li>
                 
                <li>
                  <a href="../dev/documentation.html">
                        documentation.md
                  </a>
                </li>
                 
                <li>
                  <a href="../dev/index.html">
                        index.md
                  </a>
                </li>
                 
                <li>
                  <a href="../dev/install-debian-squeeze.html">
                        install-debian-squeeze.md
                  </a>
                </li>
                 
                <li>
                  <a href="../dev/install.html">
                        install.md
                  </a>
                </li>
                 
                <li>
                  <a href="../dev/testing.html">
                        testing.md
                  </a>
                </li>
                 
                <li>
                  <a href="../intro/install.html">
                        install.md
                  </a>
                </li>
                 
                <li>
                  <a href="../intro/overview.html">
                        overview.md
                  </a>
                </li>
                 
                <li>
                  <a href="../intro/wtf.html">
                        wtf.md
                  </a>
                </li>
                 
                <li>
                  <a href="../recipes/django-lxml.html">
                        django-lxml.md
                  </a>
                </li>
                 
                <li>
                  <a href="../recipes/nose.html">
                        nose.md
                  </a>
                </li>
                 
                <li>
                  <a href="../reference/cli.html">
                        cli.md
                  </a>
                </li>
                 
                <li>
                  <a href="../reference/features.html">
                        features.md
                  </a>
                </li>
                 
                <li>
                  <a href="../reference/languages.html">
                        languages.md
                  </a>
                </li>
                 
                <li>
                  <a href="../reference/terrain.html">
                        terrain.md
                  </a>
                </li>
                 
                <li>
                  <a href="./django.html">
                        django.md
                  </a>
                </li>
                 
                <li>
                  <a href="./multiline.html">
                        multiline.md
                  </a>
                </li>
                 
                <li>
                  <a href="./scenario-outlines.html">
                        scenario-outlines.md
                  </a>
                </li>
                 
                <li>
                  <a href="./simple.html">
                        simple.md
                  </a>
                </li>
                 
                <li>
                  <a href="./steps-from-step-definitions.html">
                        steps-from-step-definitions.md
                  </a>
                </li>
                 
                <li>
                  <a href="./tables.html">
                        tables.md
                  </a>
                </li>
                 
              </ul>
            </div>
          </div>
        </div>
      </div>
    </footer>
  </body>
</html>